From 523d642f715ca4fee7237b89ecc3fca80596dd37 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Fri, 29 Sep 2006 09:23:18 +0100 Subject: [PATCH] [BLK] front: Flush workqueues with no locks held. Operation can sleep. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 83630ee2ec..e79b653a97 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -355,9 +355,11 @@ static void blkfront_closing(struct xenbus_device *dev) blk_stop_queue(info->rq); /* No more gnttab callback work. */ gnttab_cancel_free_callback(&info->callback); - flush_scheduled_work(); spin_unlock_irqrestore(&blkif_io_lock, flags); + /* Flush gnttab callback work. Must be done with no locks held. */ + flush_scheduled_work(); + xlvbd_del(info); xenbus_frontend_closed(dev); @@ -714,9 +716,11 @@ static void blkif_free(struct blkfront_info *info, int suspend) blk_stop_queue(info->rq); /* No more gnttab callback work. */ gnttab_cancel_free_callback(&info->callback); - flush_scheduled_work(); spin_unlock_irq(&blkif_io_lock); + /* Flush gnttab callback work. Must be done with no locks held. */ + flush_scheduled_work(); + /* Free resources associated with old device channel. */ if (info->ring_ref != GRANT_INVALID_REF) { gnttab_end_foreign_access(info->ring_ref, 0, -- 2.30.2